# -*- coding: utf-8 -*-
# @Time    : 2017/12/26 22:58
# @Author  : xiaoxiaowang
# @Email   : wangqunsong@hotmail.com
# @File    : selectSort.py
# @Software: PyCharm
class SelectSort(object):


    def __init__(self,list):
        self.list = list
        self.list_len = len(list)

    def select_sort(self):
        for i in range(self.list_len - 1):
            min = i
            for j in range(i + 1 ,self.list_len):
                if self.list[min] > self.list[j]:
                    min = j
                self.list[i], self.list[min] = self.list[min], self.list[i]
        return self.list

    def show(self):
        print(self.select_sort())


if __name__ == '__main__':
    list_test = [3, 4, 1, 6, 2, 9, 7, 0, 8, 5, 24, 34, 99, 11, 214]
    selectSort = SelectSort(list_test)
    selectSort.show()
